# $Id$
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Balló György <ballogyor+arch at gmail dot com>

pkgname=gupnp-dlna
pkgver=0.10.5
pkgrel=2
pkgdesc="Library to ease DLNA-related bits for applications using gupnp"
arch=(i686 x86_64)
url="https://wiki.gnome.org/Projects/GUPnP"
license=(LGPL)
depends=(gst-plugins-base-libs)
makedepends=(gobject-introspection gtk-doc vala git autoconf-archive)
_commit=d8c2a40767e47fe8427e019cad5359092a8fa662  # tags/gupnp-dlna-0.10.5^0
source=("git+https://git.gnome.org/browse/gupnp-dlna#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^gupnp-dlna-//;s/-/+/g'
}

prepare() {
  cd $pkgname
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
              --disable-static --disable-Werror --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname
  make check
}

package() {
  cd $pkgname
  make -j1 DESTDIR="$pkgdir" install
}
